all: ui2py

DESKTOP_FILES=\
	one_click_installer.desktop \
	one_click_installer_deb.desktop

MIME_DESKTOP_FILES=\
	one_click_installer_mime.desktop
	
BIN_FILES=\
	bin/one-click-installer

USR_LIB_FILES=\
	$(wildcard *.py) \
	$(wildcard *.pyxpm)
	
OCI_FILES=$(wildcard examples/*.oci)
	
USR_LIB_DIRS=\
	translations
	
USR_LIB_DESTDIR=$(DESTDIR)/usr/lib/one_click_installer/
DESKTOP_DIR=$(DESTDIR)/usr/share/applications/kde/
MIME_DIR=$(DESTDIR)/usr/share/mimelnk/application/
BIN_DIR=$(DESTDIR)/usr/bin/

install:
	make -f Makefile.ui2py
	make -f Makefile.messages compile
	mkdir -p $(USR_LIB_DESTDIR)
	cp $(USR_LIB_FILES) $(USR_LIB_DESTDIR)
	cp -r $(USR_LIB_DIRS) $(USR_LIB_DESTDIR)
	mkdir -p $(DESKTOP_DIR)
	cp $(DESKTOP_FILES) $(DESKTOP_DIR)
	mkdir -p $(MIME_DIR)
	cp $(MIME_DESKTOP_FILES) $(MIME_DIR)
	mkdir -p $(BIN_DIR)
	cp $(BIN_FILES) $(BIN_DIR)
	mkdir -p $(DESTDIR)/usr/lib/mime/packages/
	install -m 0644 one_click_install.mime $(DESTDIR)/usr/lib/mime/packages/one_click_install
	install -m 0644 one_click_install_deb.mime $(DESTDIR)/usr/lib/mime/packages/one_click_install_deb
	mkdir -p $(DESTDIR)/usr/share/doc/one-click-installer/examples
	for i in $(OCI_FILES) examples/README; do install -m 0644 $$i $(DESTDIR)/usr/share/doc/one-click-installer/examples/; done
	find $(USR_LIB_DESTDIR) -name CVS | xargs rm -rf

ui2py:
	make -f Makefile.ui2py	